#include <bits/stdc++.h>
using namespace std;
int r[100005];
int f[100005];
int n;
int work(int p){
    int left = 0;
    int right = n;
    int mid;
    while(left<right){
        mid = (left+right) >> 1;
        if(r[mid]<=r[p]){
            left = mid+1;
        }
        else{
            right = mid;
        }
    }
    return left;
}
int main(){
    freopen("duel.in", "r", stdin);
    freopen("duel.out", "w", stdout);
    scanf("%d", &n);
    for(int i=0;i<n;i++){
        scanf("%d", &r[i]);
    }
    r[n] = INT_MAX;
    sort(r, r+n);
    for(int i=0;i<n;i++){
        f[i] = work(i);
    }
    int first = 0;
    int second = 1;
    int alive = n;
    int cnt = 0;
    int last = -1145;
    while(alive>0&&cnt<n){
        second = max(f[first], last+1);
        last = second;
        if(second>=n){
            break;
        }
        alive--;
        first++;
        cnt++;
    }
    printf("%d", alive);
    return 0;
}
